/**
 * 
 */
package com.jszw.bcp.test;

import java.lang.reflect.Proxy;

/**
 * @author zhengzw
 *
 */
public class ProxyUtils {
	public static HttpRequest getRequest() {
		HttpRequest request = new HttpRequestImpl();
		Delegate delegate = new Delegate();
		delegate.setFactory(Factory.getInstance());
		HttpRequest proxy = (HttpRequest) Proxy.newProxyInstance(request.getClass().getClassLoader(),
				request.getClass().getInterfaces(), delegate);
		
		return proxy;
	}
}
